package cn.com.git.example.common.auth;

import cn.com.git.example.common.base.BaseResultConstant;

/**
 * @author zhangzhenfu
 * @Description
 * @date 2020/4/8 14:55
 */
public enum AuthResultConstant implements BaseResultConstant {
    FAILED(false, 0, "操作失败"),
    SUCCESS(true, 1, "操作成功"),
    INVALID_LENGTH(false, 10001, "无效长度"),
    EMPTY_USERNAME(false, 10101, "用户名不能为空"),
    EMPTY_PASSWORD(false, 10102, "密码不能为空"),
    INVALID_USERNAME(false, 10103, "帐号不存在"),
    INVALID_PASSWORD(false, 10104, "密码错误"),
    INVALID_ACCOUNT(false, 10105, "无效帐号"),
    EMPTY_VERIFY_CODE(false, 10106, "验证码不能为空"),
    INVALID_VERIFY_CODE(false, 10107, "验证码失效"),
    ERROR_VERIFY_CODE(false, 10108, "验证码错误"),
    DISABLED_LOGIN(false, 10109, "登录禁用"),
    NOT_LOGIN(false, 20001, "Not logged in"),
    ALREADY_LOGIN(true, 20002, "Already logged in");
//
//    private static Map<Integer,String> enumMap = new HashMap<>();
//    static {
//        UpmsResultConstant[] list = UpmsResultConstant.values();
//        for(UpmsResultConstant e:list){
//            enumMap.put(e.code,e.message);
//        }
//    }


    private boolean success;

    private int code;

    private String message;

    AuthResultConstant(boolean success, int code, String message) {
        this.code = code;
        this.message = message;
        this.success = success;
    }

    @Override
    public boolean getSuccess() {
        return success;
    }

    @Override
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
